<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登陆</title>
	<script type="text/javascript" src="js/jquery-3.4.0.min.js"></script>
	<link rel="stylesheet" href="layui/css/layui.css">
	<script src="layui/layui.all.js"></script>
</head>
<style>
*{
    margin: 0;
    padding: 0;
}
body{
	width:100%;
	height:100%;
	background:url("images/0.jpg")no-repeat;
	background-size:cover;
	overflow:hidden;
}
.frame{
	width:800px;
	height:600px;
	
	margin-left:auto;
	margin-right:auto;
}	
.formtable{
	width:250px;
	height:450px;
	margin-left:auto;
	margin-right:auto;
	
	
}

.input_outer{
padding-top:50px;
}

h1{
width:550px;
margin-left:auto;
margin-right:auto;
padding-top:50px;
font-size:60px;
}
button{
margin-top:50px;
margin-left:40px;
width:50px;
height:30px;
}

</style>
<body >
	<div>
		<div class="frame">
			<h1>摩托车零件出口系统</h1>
			<form action="#" class="formtable">
				<div class="input_outer">
					<span class="glyphicon glyphicon-user">用户类型：</span>
					<select name="type" class="text" id="select">
						<option class="text" value="2">----请选择身份----</option>
						<option value="7" >系统管理员</option>
						<option value="2" >销售员</option>
						<option value="3" >销售经理</option>
						<option value="4" >包装员</option>
						<option value="5" >包装经理</option>
						<option value="6" >集装箱员</option>
						<option value="1" >客户</option>
					</select>
				</div>
				<div class="input_outer">
					<span class="glyphicon glyphicon-user">账 号 ：</span>
					<input name="userId" id="userId" class="text" type="text" placeholder="请输入用户ID">
				</div>
				<div class="input_outer">
					<span class="glyphicon glyphicon-lock">密 码 ：</span>
					<input name="password" id="password" class="text"  stlye="position:absolute; z-index:100;"value="" type="password" placeholder="请输入密码">
				</div>
				<button type="button" id="login">登陆</button>
				<button type="button" id="reset">注册</button>
			</form>
		</div>
	</div>
	
</body>

<script>
$(function(){
	
	$("#login").on("click",function(){
		var type = $("#select option:checked").val();
		console.log(type);
		var userId = $("#userId").val();
		var password = $("#password").val();
		$.ajax({
			type:"post",
             
              url: "/selectUser",
      	      dataType:"json",
    		  async:false,
              data: {
            	  "userId":userId,
            	  "password":password,
            	  "type":type
                    },
              success:function(data){
            	 if(data.msg==1){

            		 window.location.href="/kehu";
            		 
            	 }else if(data.msg==2){
            		 
            		 window.location.href="/xiaoshouyuan";
            		 
            	 }else if(data.msg==3){
            		 
            		 window.location.href="/xiaoshoujingli";
            		 
            		 
            	 }else if(data.msg==4){
            		 window.location.href="/baozhuangyuan";
            		 
            	 }else if(data.msg==5){
            		 window.location.href="/baozhuangjingli";
            		 
            	 }else if(data.msg==6){
            		 window.location.href="/jizhuangxiangyuan";
            		 
            	 }else if(data.msg==7){
            		 window.location.href="/Admin";
            		 
            	 }else{
            		 window.location.href="/Login";
            		 alert("输入账号或密码有误");
            	 }
            	 
            	 
              }
		});
	})	
		
		
	})
	








</script>
<!-- <script>
			$(function() {
				$("#login").on(
						"click",
						function() {
							var select = $("#select option:checked").text();
							var userId = $("#userId").val();
							var password = $("#password").val();
							if (select == "----请选择身份----" || userId == ""
									|| password == "" ) {
								layer.tips('请填写完整', 'button', {
									tips : [ 1, '#3595CC' ],
									time : 4000
								});
							}
						})
				$("#login").on("click", function(){
					var select = $("#select option:checked").text();
					var userId = $("#userId").val();
					var password = $("#password").val();
					
					$.ajax({
						type:"post",
		                  type: "Post",
		                  url: "/Checklogin",
		          	      dataType:"json",
		        		  async:false,
		                  data: {
		                	  "userId":userId,
		                	  "password":password,
		                	  "select":select
		                        },
		                  success:function(data){
		                	 if(data.msg == "学生"){
	
		                		 window.location.href="/Student";
		                		 
		                	 }else if(data.msg == "教师"){
		                		 
		                		 window.location.href="/Teacher";
		                		 
		                	 }else if(data.msg == "管理员"){
		                		 
		                		 window.location.href="/admin";
		                		 
		                	 }else{
		                		 
		                		 window.location.href="/Login";
		                		 alert("输入账号或密码有误");
		                		 
		                	 }
		                  }
					});
				})
				
				 
			})
</script>  -->
</html>